package com.xlh.service.fallback;

import com.xlh.domain.Product;
import com.xlh.service.ProductService;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/*@Component
@Slf4j
public class ProductServiceFallBackFactory implements FallbackFactory<ProductService> {
    @Override
    public ProductService create(Throwable throwable) {
        return new ProductService() {
            @Override
            public Product findByPid(Integer pid) {
                log.error("容错异常测试",throwable);
                throwable.printStackTrace();
                Product product = new Product();
                product.setPid(-100);
                return product;
            }
        };
    }
}*/
